﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace Mayn.Video
{
    public class DownloadTool
    {
        public static void DownloadFile(string localFolder, string remoteFolder, string fileName)
        {
            string url = remoteFolder + fileName;
            string path = localFolder + fileName;
            string dir = Path.GetDirectoryName(path);
            if (!Directory.Exists(dir))
                Directory.CreateDirectory(dir);
            var wc = new WebClient();
            wc.Headers["User-Agent"] = "blah";
            wc.DownloadFile(url, path);
        }
    }

    internal class AppTool
    {
        public static void Start(string appName)
        {
            Process.Start(appName, "ok");
        }

        internal static void DeleteTempFolder(string folder)
        {
            Directory.Delete(folder, true);
        }
    }
}
